package com.weasing.res.dao.impl;

import com.weasing.res.dao.IWxChecklistDao;
import com.weasing.res.dao.base.impl.BaseDaoImpl;
import com.weasing.res.domain.WxChecklist;
import com.weasing.res.utils.PageBean;
import java.util.HashMap;
import java.util.Map;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Administrator
 */
@Repository
public class WxChecklistDaoImpl extends BaseDaoImpl<WxChecklist> implements IWxChecklistDao {
    @Override
	public PageBean findWxChecklistByCondition(int toadminid,int status,PageBean pageBean) {
                Map<String, Object> map = new HashMap();
                map.put("toadminid", toadminid);
                map.put("status", status);
		pageQuery(pageBean,map);
		return pageBean;
	}
        
    @Override
        public void upStatusByID(int id,int status){
            Session session = this.getSessionFactory().getCurrentSession();
//            session.beginTransaction();
            Query query = session.createQuery("update WxChecklist wc set wc.status = "+status+" where id = "+id);
            query.executeUpdate();
//            session.getTransaction().commit();
        }
    
}
